package com.shenkh.usunshine.spring.annotation;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

public class MovieRecommender {
	Logger logger = LoggerFactory.getLogger(MovieRecommender.class); 
	
	@PostConstruct
	public void init() {
		logger.info("MovieRecommender initaized");
	}
	
	@PreDestroy
	public void terminate() {
		logger.info("Terminated");
	}
	
	@Autowired
	@Qualifier("main")
	private MovieCatalog mainCatalog;
	
	@Autowired
	@Genre("action")
	private MovieCatalog actionCatalog;
	
	@Autowired
	@Offline
	private MovieCatalog offlineCatalog;

	@Autowired
	@MovieQualifier(format=Format.BLURAY, genre="comedy")
	private MovieCatalog comedyBluRayCatalog;
}
